FROM mk/jdk8:v1.0

MAINTAINER troycc

ENV \
    TZ=Asia/Shanghai \
    SPRING_PROFILES_ACTIVE=prod \
    FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS=true


ADD target/exam-mall-0.0.1-SNAPSHOT.jar exam.jar
# ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/
ADD cacert.pem /etc/ssl/certs/
EXPOSE 10086
VOLUME ["/opt/log"]
ENTRYPOINT ["java","-jar","/opt/exam.jar"]

# for ubuntu
# docker build -t exam-api:v1 .
# docker run -it -d -p 10086:10086 --name con-exam-api --restart=always -v /home/ubuntu/exam/log:/opt/log exam-api:v1


# for mac remember to del the SPRING_PROFILES_ACTIVE
#  docker build -t exam-api:v1 .
#  docker run -it --rm -p 10086:10086 --name con-exam-api  -v /Users/troy/exam/log:/opt/log exam-api:v1


